﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace AJWPFAdmin.Services.Migrations
{
    /// <inheritdoc />
    public partial class 新增称重数据缓存表 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "RowVersionTimestamp",
                table: "SystemConfigDictionaries");

            migrationBuilder.AddColumn<DateTime>(
                name: "UpdateDate",
                table: "SystemConfigDictionaries",
                type: "datetime(6)",
                nullable: true);

            migrationBuilder.CreateTable(
                name: "WeighingDataCaches",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    TicketCode = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true, comment: "业务编号")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    CarPlateNumber = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "车牌号")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    GoodsCode = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "物资编码")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    GoodsName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true, comment: "物资名称")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    GoodsWeight = table.Column<decimal>(type: "decimal(65,30)", nullable: false, comment: "运输重量"),
                    GoodsType = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true, comment: "物资类型")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    FreightUnit = table.Column<byte>(type: "tinyint unsigned", nullable: false, comment: "货运单位"),
                    Sender = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "发货单位")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Receiver = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "收货单位")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Reserve1 = table.Column<string>(type: "longtext", nullable: true, comment: "预留字段1")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Reserve2 = table.Column<string>(type: "longtext", nullable: true, comment: "预留字段2")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Reserve3 = table.Column<string>(type: "longtext", nullable: true, comment: "预留字段3")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Reserve4 = table.Column<string>(type: "longtext", nullable: true, comment: "预留字段4")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    ExpireDate = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "到期时间"),
                    SendOrReceiveFlag = table.Column<string>(type: "longtext", nullable: true, comment: "收发标志")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    PId = table.Column<int>(type: "int", nullable: false),
                    CreateDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    UpdateDate = table.Column<DateTime>(type: "datetime(6)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_WeighingDataCaches", x => x.Id);
                },
                comment: "称重数据缓存表")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.UpdateData(
                table: "CarTypes",
                keyColumn: "Id",
                keyValue: 480306L,
                column: "CreateDate",
                value: new DateTime(2024, 10, 22, 15, 0, 16, 772, DateTimeKind.Local).AddTicks(1573));

            migrationBuilder.UpdateData(
                table: "CarTypes",
                keyColumn: "Id",
                keyValue: 480307L,
                column: "CreateDate",
                value: new DateTime(2024, 10, 22, 15, 0, 16, 772, DateTimeKind.Local).AddTicks(1573));

            migrationBuilder.UpdateData(
                table: "CarTypes",
                keyColumn: "Id",
                keyValue: 480308L,
                column: "CreateDate",
                value: new DateTime(2024, 10, 22, 15, 0, 16, 772, DateTimeKind.Local).AddTicks(1573));

            migrationBuilder.UpdateData(
                table: "CarTypes",
                keyColumn: "Id",
                keyValue: 480309L,
                column: "CreateDate",
                value: new DateTime(2024, 10, 22, 15, 0, 16, 772, DateTimeKind.Local).AddTicks(1573));

            migrationBuilder.UpdateData(
                table: "CarTypes",
                keyColumn: "Id",
                keyValue: 480310L,
                column: "CreateDate",
                value: new DateTime(2024, 10, 22, 15, 0, 16, 772, DateTimeKind.Local).AddTicks(1573));

            migrationBuilder.UpdateData(
                table: "CarTypes",
                keyColumn: "Id",
                keyValue: 480311L,
                column: "CreateDate",
                value: new DateTime(2024, 10, 22, 15, 0, 16, 772, DateTimeKind.Local).AddTicks(1573));

            migrationBuilder.UpdateData(
                table: "PlatformCustomers",
                keyColumn: "Id",
                keyValue: 480306,
                columns: new[] { "CreateDate", "ExpireDate" },
                values: new object[] { new DateTime(2024, 10, 22, 15, 0, 16, 772, DateTimeKind.Local).AddTicks(1573), new DateTime(2025, 10, 22, 15, 0, 16, 772, DateTimeKind.Local).AddTicks(1573) });

            migrationBuilder.UpdateData(
                table: "SystemConfigDictionaries",
                keyColumn: "Key",
                keyValue: (short)6,
                columns: new[] { "CreateDate", "UpdateDate" },
                values: new object[] { new DateTime(2024, 10, 22, 15, 0, 16, 772, DateTimeKind.Local).AddTicks(1573), null });

            migrationBuilder.UpdateData(
                table: "SystemConfigDictionaries",
                keyColumn: "Key",
                keyValue: (short)1000,
                columns: new[] { "CreateDate", "UpdateDate" },
                values: new object[] { new DateTime(2024, 10, 22, 15, 0, 16, 772, DateTimeKind.Local).AddTicks(1573), null });

            migrationBuilder.UpdateData(
                table: "SystemConfigDictionaries",
                keyColumn: "Key",
                keyValue: (short)1001,
                columns: new[] { "CreateDate", "UpdateDate" },
                values: new object[] { new DateTime(2024, 10, 22, 15, 0, 16, 772, DateTimeKind.Local).AddTicks(1573), null });

            migrationBuilder.UpdateData(
                table: "SystemConfigDictionaries",
                keyColumn: "Key",
                keyValue: (short)1002,
                columns: new[] { "CreateDate", "UpdateDate" },
                values: new object[] { new DateTime(2024, 10, 22, 15, 0, 16, 772, DateTimeKind.Local).AddTicks(1573), null });

            migrationBuilder.UpdateData(
                table: "SystemDictionaries",
                keyColumn: "Id",
                keyValue: 1L,
                column: "CreateDate",
                value: new DateTime(2024, 10, 22, 15, 0, 16, 772, DateTimeKind.Local).AddTicks(6413));

            migrationBuilder.UpdateData(
                table: "SystemDictionaries",
                keyColumn: "Id",
                keyValue: 2L,
                column: "CreateDate",
                value: new DateTime(2024, 10, 22, 15, 0, 16, 772, DateTimeKind.Local).AddTicks(6472));

            migrationBuilder.UpdateData(
                table: "SystemDictionaries",
                keyColumn: "Id",
                keyValue: 3L,
                column: "CreateDate",
                value: new DateTime(2024, 10, 22, 15, 0, 16, 772, DateTimeKind.Local).AddTicks(6506));

            migrationBuilder.UpdateData(
                table: "SystemRoles",
                keyColumn: "Id",
                keyValue: 480306L,
                columns: new[] { "CreateDate", "UpdateDate" },
                values: new object[] { new DateTime(2024, 10, 22, 15, 0, 16, 772, DateTimeKind.Local).AddTicks(1573), new DateTime(2024, 10, 22, 15, 0, 16, 772, DateTimeKind.Local).AddTicks(1573) });

            migrationBuilder.UpdateData(
                table: "SystemUsers",
                keyColumn: "Id",
                keyValue: 480306L,
                columns: new[] { "CreateDate", "UpdateDate" },
                values: new object[] { new DateTime(2024, 10, 22, 15, 0, 16, 772, DateTimeKind.Local).AddTicks(1573), new DateTime(2024, 10, 22, 15, 0, 16, 772, DateTimeKind.Local).AddTicks(1573) });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "WeighingDataCaches");

            migrationBuilder.DropColumn(
                name: "UpdateDate",
                table: "SystemConfigDictionaries");

            migrationBuilder.AddColumn<DateTime>(
                name: "RowVersionTimestamp",
                table: "SystemConfigDictionaries",
                type: "timestamp(6)",
                rowVersion: true,
                nullable: true);

            migrationBuilder.UpdateData(
                table: "CarTypes",
                keyColumn: "Id",
                keyValue: 480306L,
                column: "CreateDate",
                value: new DateTime(2024, 9, 11, 20, 0, 52, 39, DateTimeKind.Local).AddTicks(5749));

            migrationBuilder.UpdateData(
                table: "CarTypes",
                keyColumn: "Id",
                keyValue: 480307L,
                column: "CreateDate",
                value: new DateTime(2024, 9, 11, 20, 0, 52, 39, DateTimeKind.Local).AddTicks(5749));

            migrationBuilder.UpdateData(
                table: "CarTypes",
                keyColumn: "Id",
                keyValue: 480308L,
                column: "CreateDate",
                value: new DateTime(2024, 9, 11, 20, 0, 52, 39, DateTimeKind.Local).AddTicks(5749));

            migrationBuilder.UpdateData(
                table: "CarTypes",
                keyColumn: "Id",
                keyValue: 480309L,
                column: "CreateDate",
                value: new DateTime(2024, 9, 11, 20, 0, 52, 39, DateTimeKind.Local).AddTicks(5749));

            migrationBuilder.UpdateData(
                table: "CarTypes",
                keyColumn: "Id",
                keyValue: 480310L,
                column: "CreateDate",
                value: new DateTime(2024, 9, 11, 20, 0, 52, 39, DateTimeKind.Local).AddTicks(5749));

            migrationBuilder.UpdateData(
                table: "CarTypes",
                keyColumn: "Id",
                keyValue: 480311L,
                column: "CreateDate",
                value: new DateTime(2024, 9, 11, 20, 0, 52, 39, DateTimeKind.Local).AddTicks(5749));

            migrationBuilder.UpdateData(
                table: "PlatformCustomers",
                keyColumn: "Id",
                keyValue: 480306,
                columns: new[] { "CreateDate", "ExpireDate" },
                values: new object[] { new DateTime(2024, 9, 11, 20, 0, 52, 39, DateTimeKind.Local).AddTicks(5749), new DateTime(2025, 9, 11, 20, 0, 52, 39, DateTimeKind.Local).AddTicks(5749) });

            migrationBuilder.UpdateData(
                table: "SystemConfigDictionaries",
                keyColumn: "Key",
                keyValue: (short)6,
                column: "CreateDate",
                value: new DateTime(2024, 9, 11, 20, 0, 52, 39, DateTimeKind.Local).AddTicks(5749));

            migrationBuilder.UpdateData(
                table: "SystemConfigDictionaries",
                keyColumn: "Key",
                keyValue: (short)1000,
                column: "CreateDate",
                value: new DateTime(2024, 9, 11, 20, 0, 52, 39, DateTimeKind.Local).AddTicks(5749));

            migrationBuilder.UpdateData(
                table: "SystemConfigDictionaries",
                keyColumn: "Key",
                keyValue: (short)1001,
                column: "CreateDate",
                value: new DateTime(2024, 9, 11, 20, 0, 52, 39, DateTimeKind.Local).AddTicks(5749));

            migrationBuilder.UpdateData(
                table: "SystemConfigDictionaries",
                keyColumn: "Key",
                keyValue: (short)1002,
                column: "CreateDate",
                value: new DateTime(2024, 9, 11, 20, 0, 52, 39, DateTimeKind.Local).AddTicks(5749));

            migrationBuilder.UpdateData(
                table: "SystemDictionaries",
                keyColumn: "Id",
                keyValue: 1L,
                column: "CreateDate",
                value: new DateTime(2024, 9, 11, 20, 0, 52, 39, DateTimeKind.Local).AddTicks(7964));

            migrationBuilder.UpdateData(
                table: "SystemDictionaries",
                keyColumn: "Id",
                keyValue: 2L,
                column: "CreateDate",
                value: new DateTime(2024, 9, 11, 20, 0, 52, 39, DateTimeKind.Local).AddTicks(7983));

            migrationBuilder.UpdateData(
                table: "SystemDictionaries",
                keyColumn: "Id",
                keyValue: 3L,
                column: "CreateDate",
                value: new DateTime(2024, 9, 11, 20, 0, 52, 39, DateTimeKind.Local).AddTicks(7993));

            migrationBuilder.UpdateData(
                table: "SystemRoles",
                keyColumn: "Id",
                keyValue: 480306L,
                columns: new[] { "CreateDate", "UpdateDate" },
                values: new object[] { new DateTime(2024, 9, 11, 20, 0, 52, 39, DateTimeKind.Local).AddTicks(5749), new DateTime(2024, 9, 11, 20, 0, 52, 39, DateTimeKind.Local).AddTicks(5749) });

            migrationBuilder.UpdateData(
                table: "SystemUsers",
                keyColumn: "Id",
                keyValue: 480306L,
                columns: new[] { "CreateDate", "UpdateDate" },
                values: new object[] { new DateTime(2024, 9, 11, 20, 0, 52, 39, DateTimeKind.Local).AddTicks(5749), new DateTime(2024, 9, 11, 20, 0, 52, 39, DateTimeKind.Local).AddTicks(5749) });
        }
    }
}
